import http from "@/api";
import { AddMenuParam, EditMenuParam, GetMenuParams, MenuItemType ,PutMenuStateParams} from "@Tea/model";

const menuMangeHttp = {
  getSystemMenu: (params: GetMenuParams) => http<MenuItemType[]>({
    method: "post",
    url: "/admin/systemManage/systemPowerManage/menuManage/pageList",
    params
  }),
  addMenu: (params: AddMenuParam) => http({
    method: "post",
    url: "/admin/systemManage/systemPowerManage/menuManage/addMenu",
    params
  }),
  editMenu: (params: EditMenuParam) => http({
    method: "put",
    url: "/admin/systemManage/systemPowerManage/menuManage/editMenu",
    params
  }),
  deleteMenu: (menuIds: MenuItemType["menuId"][]) => http({
    method: "post",
    url: `/admin/systemManage/systemPowerManage/menuManage/deleteMenu`,
    params: {menuIds}
  }),
  putMenuState: (params: PutMenuStateParams) => http({
    method: "put",
    url: "/admin/systemManage/systemPowerManage/menuManage/putMenuState",
    params
  }),
}

export default menuMangeHttp